/* @import './base.css'; */

/* CSS变量定义 */
:root {
  --color-background: #ffffff;
  --color-background-soft: #f8f9fa;
  --color-background-mute: #f3f3f3;
  
  --color-border: #ddd;
  --color-border-hover: #c1c1c1;
  
  --color-heading: #2c3e50;
  --color-text: #2c3e50;
  --color-text-light: #6c757d;
  --color-text-light-2: #adb5bd;
  
  --color-primary: #4a90e2;
  --color-primary-hover: #357abd;
  --color-success: #28a745;
  --color-danger: #dc3545;
  --color-warning: #e2a04a;
  --color-info: #17a2b8;
  
  --border-radius: 4px;
  --border-radius-lg: 8px;
  
  --spacing-xs: 0.25rem;
  --spacing-sm: 0.5rem;
  --spacing-md: 1rem;
  --spacing-lg: 1.5rem;
  --spacing-xl: 2rem;
  
  --font-size-xs: 0.75rem;
  --font-size-sm: 0.875rem;
  --font-size-base: 1rem;
  --font-size-lg: 1.125rem;
  --font-size-xl: 1.25rem;
  --font-size-2xl: 1.5rem;
  
  --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.05);
  --shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
  --shadow-md: 0 4px 6px rgba(0, 0, 0, 0.1);
  --shadow-lg: 0 10px 15px rgba(0, 0, 0, 0.1);
}

/* 暗色主题支持（可选） */
@media (prefers-color-scheme: dark) {
  :root {
    --color-background: #1a1a1a;
    --color-background-soft: #2d2d2d;
    --color-background-mute: #3a3a3a;
    
    --color-border: #444;
    --color-border-hover: #555;
    
    --color-heading: #ffffff;
    --color-text: #ffffff;
    --color-text-light: #adb5bd;
    --color-text-light-2: #6c757d;
  }
}

/* 确保全局box-sizing为border-box */
*, *::before, *::after {
  box-sizing: border-box;
}

/* 移除默认margin和padding */
* {
  margin: 0;
  padding: 0;
}

/* 确保html和body占满全屏 */
html, body {
  height: 100%;
  width: 100%;
  overflow: hidden; /* 防止3D场景出现滚动条 */
  background-color: var(--color-background);
  color: var(--color-text);
}

/* 防止在触摸设备上的默认行为 */
html {
  touch-action: manipulation;
  -webkit-touch-callout: none;
  -webkit-user-select: none;
  -khtml-user-select: none;
  -moz-user-select: none;
  -ms-user-select: none;
  user-select: none;
}

/* 但允许表单元素和文本区域被选中 */
input, textarea, select, button {
  -webkit-user-select: auto;
  -khtml-user-select: auto;
  -moz-user-select: auto;
  -ms-user-select: auto;
  user-select: auto;
}

/* 统一按钮样式 */
button {
  border: none;
  background: none;
  cursor: pointer;
  outline: none;
  border-radius: var(--border-radius);
  transition: all 0.2s ease;
}

button:focus {
  outline: 2px solid var(--color-primary);
  outline-offset: 2px;
}

button:hover {
  transform: translateY(-1px);
  box-shadow: var(--shadow-sm);
}

/* 统一输入框样式 */
input, select, textarea {
  border: 1px solid var(--color-border);
  border-radius: var(--border-radius);
  padding: var(--spacing-sm);
  font-family: inherit;
  font-size: var(--font-size-base);
  outline: none;
  background-color: var(--color-background);
  color: var(--color-text);
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

input:focus, select:focus, textarea:focus {
  border-color: var(--color-primary);
  box-shadow: 0 0 0 2px rgba(74, 144, 226, 0.2);
}

/* 确保canvas元素正确显示 */
canvas {
  display: block;
  outline: none;
}

/* 滚动条样式统一（webkit浏览器） */
::-webkit-scrollbar {
  width: 8px;
}

::-webkit-scrollbar-track {
  background: var(--color-background-soft);
}

::-webkit-scrollbar-thumb {
  background: var(--color-border);
  border-radius: var(--border-radius);
}

::-webkit-scrollbar-thumb:hover {
  background: var(--color-border-hover);
}

/* 工具提示类 */
.tooltip {
  position: relative;
  cursor: help;
}

.tooltip::after {
  content: attr(data-tooltip);
  position: absolute;
  bottom: 100%;
  left: 50%;
  transform: translateX(-50%);
  background: rgba(0, 0, 0, 0.8);
  color: white;
  padding: var(--spacing-xs) var(--spacing-sm);
  border-radius: var(--border-radius);
  font-size: var(--font-size-xs);
  white-space: nowrap;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.2s ease;
  z-index: 1000;
}

.tooltip:hover::after {
  opacity: 1;
}

#app {
  margin: 0 auto;
  font-weight: normal;
  height: 100vh;
  width: 100vw;
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
  background-color: var(--color-background);
  color: var(--color-text);
}

